import QtQuick 2.6
import QtQuick.Layouts 1.2
import QtQuick.Controls 1.4

import "../../../Base/UiBase"
import "../../../Base/Config"
import "../../../Base/UiBase/TC" as TC

import Code 1.0

import Cpp.Request 1.0 as Request

Rectangle {
    //width: parent.width
    //height: 120 * Size.ratio
    id: root
    property var news
    property alias mouseArea: mouseArea1

    color: Color.foreground
    MouseArea {
        id: mouseArea1
        anchors.fill: parent
    }
    // icon at left side
    Rectangle {
        x: 10 * Size.ratio
        y: 10 * Size.ratio
        width: 120 * Size.ratio
        height: 100 * Size.ratio
        color: iconColor
        Text {
            width: font.pixelSize * 2 + 1
            height: width
            anchors.centerIn: parent
            text: news.iconTitle
            font.pixelSize: Size.normalFont
            wrapMode: Text.WrapAnywhere
        }
    } // end icon

    // title at top
    Text {
        x: 140 * Size.ratio
        y: 10 * Size.ratio
        width: 560 * Size.ratio
        height: 90 * Size.ratio
        clip: true
        elide: Text.ElideRight

        color: Color.input
        font.pixelSize: Size.titleFont
        text: news.title
    } // end title

    // time at left bottom
    Text {
        x: 140 * Size.ratio
        y: 90 * Size.ratio
        color: Color.input
        font.pixelSize: Size.smallFont
        text: Helper.dateToReadable(news.time)
    } // end time
    BottomDivider {
    }
}
